<template>
  <div>
      <el-tabs type="card" v-model="activeName" @tab-click="handleClick" editable>
        <el-tab-pane v-for="item in list" :label="item.label" :name="item.name"></el-tab-pane>
      </el-tabs>
      <router-view></router-view>
  </div>
</template>
<script>
  export default {
    name: 'App',
    data () {
        return {
          msg:'Hello World',
          list:[
            {
                name:'/tabs/1',
                label:'用户管理'
            },
            {
              name:'/tabs/2',
              label:'配置管理'
            },
            {
              name:'/tabs/3',
              label:'角色管理'
            }
          ],
          activeName:'1'
        }
    },
  methods:{
    handleClick (tab, event) {
      this.$router.push(tab.name)
    }
  },
    created () {
        this.activeName = this.$route.path;
    }
  }
</script>
<style>

</style>
